#include <boost/filesystem.hpp>

int main()
{
	boost::filesystem::path p1("C:\\");
	boost::filesystem::path p2("C:\\windows\\System");
	boost::filesystem::path p3(L"C:\\Boost C++ \u5e93");
	boost::filesystem::path p4("/");

	//* native(), string(), and generic_string()
	std::wcout << p2.native() << std::endl;

	std::cout << p2.string() <<std::endl;
	std::wcout << p2.wstring() << std::endl;

	std::cout << p2.generic_string() << std::endl;
	std::wcout << p2.generic_wstring() << std::endl;

	std::cout << p4.string() << std::endl;
	std::cout << p4.generic_string() << std::endl;

	//* return value of "C:\Windows\System" and "C:\Windows\System\" are different
	std::cout << p2.root_name() << "\t" << std::boolalpha << p2.has_root_name() << std::endl;
	std::cout << p2.root_directory() << "\t" << std::boolalpha << p2.has_root_directory() << std::endl;
	std::cout << p2.root_path() << "\t" << std::boolalpha << p2.has_root_path() << std::endl;
	std::cout << p2.relative_path() << "\t" << std::boolalpha << p2.has_relative_path() << std::endl;
	std::cout << p2.parent_path() << "\t" << std::boolalpha << p2.has_parent_path() << std::endl;
	std::cout << p2.filename() << "\t" << std::boolalpha << p2.has_filename() << std::endl;
	//* get stem and extension name
	std::cout << p2.stem() << " : " << p2.extension() << std::endl;
	//* iterator
	for (boost::filesystem::path::iterator it = p2.begin(); it!=p2.end(); ++it)
		std::cout << *it << std::endl;
	//* operator/=
	p2 /= "Debug.pdb";
	std::cout << p2.string() << std::endl;
	p2.replace_extension(".dll"); //* "dll" doesn't work as expected.
	std::cout << p2.string() << std::endl;
	p2.remove_filename();
	std::cout << p2.string() << std::endl;

	boost::filesystem::path p5(".");
	// std::cout << p5.make_absolute() << std::endl; //*do not have this member function?

	boost::filesystem::path p6("C:/windows/System");
	std::cout << p6.make_preferred() << std::endl;
}